﻿using System.Diagnostics.Contracts;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    struct IcvFont
    {
        private ushort _value;
        public static implicit operator IcvFont(ushort value)
        {
            Contract.Requires(value >= Default);
            Contract.Requires(value <= 0x003F || value == Value1 || value == Value2);
            return new IcvFont() {_value = value};
        }
        public static explicit operator ushort(IcvFont value)
        {
            return value._value;
        }
        public static bool operator ==(IcvFont value, IcvFont value2)
        {
            return value._value == value2._value;
        }

        public static bool operator !=(IcvFont value, IcvFont value2)
        {
            return !(value == value2);
        }
        public static ushort Value1 { get { return 0x0051; } }
        public static ushort Value2 { get { return 0x7FFF; } }

        public static ushort Default
        {
            get { return 8; }
        }
    }
}